add_library(mavsdk_camera
    camera.cpp
    camera_impl.cpp
    camera_definition.cpp
    camera_definition_files/generated/camera_definition_files.cpp
)

target_link_libraries(mavsdk_camera
    PUBLIC
    mavsdk
    PRIVATE
    tinyxml2::tinyxml2
    CURL::libcurl
)

set_target_properties(mavsdk_camera
    PROPERTIES COMPILE_FLAGS ${warnings}
)

target_include_directories(mavsdk_camera
    PRIVATE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/camera_definition_files/generated>
    PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include/mavsdk>
    )

install(TARGETS mavsdk_camera
    EXPORT mavsdk-targets
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    )

install(FILES
    include/plugins/camera/camera.h
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mavsdk/plugins/camera
)

list(APPEND UNIT_TEST_SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/camera_definition_test.cpp
)
set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE)
